/*
 * PDF解析相关API
 *
 * @Author:    1024创新实验室-主任：卓大
 * @Date:      2024-01-01 00:00:00
 * @Wechat:    zhuda1024
 * @Email:     lab1024@163.com
 * @Copyright  1024创新实验室 （ https://1024lab.net ），Since 2012
 */

import { postRequest, getRequest } from '/@/lib/axios';

export const pdfApi = {
  /**
   * 上传并解析PDF文件
   */
  uploadAndParse: (file, uploadUserId) => {
    const formData = new FormData();
    formData.append('file', file);
    formData.append('uploadUserId', uploadUserId);
    return postRequest('/pdf/upload', formData, {
      headers: {
        'Content-Type': 'multipart/form-data',
      },
    });
  },

  /**
   * 检查OCR配置状态
   */
  checkOcrConfig: () => {
    return getRequest('/pdf/ocr/check');
  },

  /**
   * 获取PDF配置信息
   */
  getPdfConfig: () => {
    return getRequest('/pdf/config');
  },
}; 